﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.Text;

namespace CommonTest
{
    public class User
    {
        [Required]
        public long Id { get; set; }

        [Required(ErrorMessage = "请输入名称")]
        public string Name { get; set; }

        [StringLength(20, MinimumLength = 10), MaxLength(20)]
        public string Name2 { get; set; }

        [Range(10, 100, ErrorMessage = "数字在10-100之间") ] 
        public int Age { get; set; }
    }
}
